package com.lvhx.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(
    topic = "order-topic",
    consumerGroup = "my-consumer-group"
)
public class OrderMessageConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("处理订单消息: " + message);
        // 实际业务逻辑（如更新订单状态）
    }
}